package github.kawaiior.yuanchuxiuzhen.common.world.biomes;

import github.kawaiior.yuanchuxiuzhen.Yuanchuxiuzhen;
import github.kawaiior.yuanchuxiuzhen.core.init.BlockInit;
import net.minecraft.block.Blocks;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.WorldGenRegistries;
import net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.ISurfaceBuilderConfig;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;

public class ModConfiguredSurfaceBuilders {
    // TEST
    public static ConfiguredSurfaceBuilder<?> RIFT_SURFACE = register("rift_surface",
            SurfaceBuilder.DEFAULT.func_242929_a(new SurfaceBuilderConfig(
                    Blocks.REDSTONE_BLOCK.getDefaultState(),
                    Blocks.MAGMA_BLOCK.getDefaultState(),
                    Blocks.RED_CONCRETE.getDefaultState()
            )));

    public static ConfiguredSurfaceBuilder<?> HELL_SURFACE = register("hell_surface",
            SurfaceBuilder.NETHER.func_242929_a(new SurfaceBuilderConfig(
                    BlockInit.MOURN_SOIL_BLOCK.get().getDefaultState(),
                    BlockInit.HELL_ROCK_BLOCK.get().getDefaultState(),
                    BlockInit.MOURN_SOIL_BLOCK.get().getDefaultState()
            )));

    private static <SC extends ISurfaceBuilderConfig>ConfiguredSurfaceBuilder<SC> register(String name,
                                                                                           ConfiguredSurfaceBuilder<SC> csb) {
        return WorldGenRegistries.register(WorldGenRegistries.CONFIGURED_SURFACE_BUILDER,
                Yuanchuxiuzhen.prefix(name), csb);
    }
}